package thread;

public class J_Thread extends Thread {
    private int m_threadID;

    public J_Thread(int i) {
        m_threadID = i;
        System.out.println("create threda i = " + i);

    }

    @Override
    public void run() {
        for (int i = 0; i < 3; i++) {
            System.out.println("thread run i:" + i);
            try {
                Thread.sleep((int) (Math.random() * 1000));
            } catch (InterruptedException e) {
                System.out.println("Exception InterruptedException:" + e);
                e.printStackTrace();
            }
        }
    }

    public static void main(String args[]) {
        System.out.println("main satrt");
        new J_Thread(1).start();
        new J_Thread(2).start();
        System.out.println("main end");
    }
}
